package com.esri.core.map;

import com.esri.core.internal.util.d;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;

/* loaded from: classes.dex */
public class LayerTimeOptions implements LayerInfoItem {
    private int a;
    private TimeOptions b;

    public LayerTimeOptions(int i) {
        this(i, new TimeOptions());
    }

    public LayerTimeOptions(int i, TimeOptions timeOptions) {
        setId(i);
        setTimeOptions(timeOptions);
    }

    @Override // com.esri.core.map.LayerInfoItem
    public int getId() {
        return this.a;
    }

    @Override // com.esri.core.map.LayerInfoItem
    public void setId(int i) {
        this.a = i;
    }

    public TimeOptions getTimeOptions() {
        return this.b;
    }

    public void setTimeOptions(TimeOptions timeOptions) {
        this.b = timeOptions;
    }

    @Override // com.esri.core.map.LayerInfoItem
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a = d.a(stringWriter);
        toJson(a);
        a.close();
        return stringWriter.toString();
    }

    public void toJson(JsonGenerator jsonGenerator) throws Exception {
        jsonGenerator.writeFieldName(Integer.valueOf(this.a).toString());
        jsonGenerator.writeRawValue(this.b.toJson());
    }
}
